home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / LittleButtonImages.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  3.8 KB  |  109 lines  |  [TEXT/KAHL]

  1. /* LittleButtonImages.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    Out Of Phase:  Digital Music Synthesis on General Purpose Computers    */
  5. /*    Copyright (C) 1994  Thomas R. Lawrence                                 */
  6. /*                                                                           */
  7. /*    This program is free software; you can redistribute it and/or modify   */
  8. /*    it under the terms of the GNU General Public License as published by   */
  9. /*    the Free Software Foundation; either version 2 of the License, or      */
  10. /*    (at your option) any later version.                                    */
  11. /*                                                                           */
  12. /*    This program is distributed in the hope that it will be useful,        */
  13. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  14. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
  15. /*    GNU General Public License for more details.                           */
  16. /*                                                                           */
  17. /*    You should have received a copy of the GNU General Public License      */
  18. /*    along with this program; if not, write to the Free Software            */
  19. /*    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
  20. /*                                                                           */
  21. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24.  
  25. #include "MiscInfo.h"
  26. #include "Audit.h"
  27. #include "Debug.h"
  28. #include "Definitions.h"
  29.  
  30. #define Compiling_LittleButtonImages
  31. #include "LittleButtonImages.h"
  32. #include "Screen.h"
  33.  
  34.  
  35. /* these bitmaps are 12x12 pixels */
  36. Bitmap*                                            PlusSignNormal;
  37. Bitmap*                                            PlusSignMouseDown;
  38. Bitmap*                                            MinusSignNormal;
  39. Bitmap*                                            MinusSignMouseDown;
  40.  
  41.  
  42. static unsigned char                oPlusSignNormal[] =
  43.     {
  44.         0xFF,0xF0,0x80,0x10,0x80,0x10,0x86,0x10,0x86,0x10,0x9F,0x90,
  45.         0x9F,0x90,0x86,0x10,0x86,0x10,0x80,0x10,0x80,0x10,0xFF,0xF0
  46.     };
  47.  
  48. static unsigned char                oPlusSignMouseDown[] =
  49.     {
  50.         0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xF9,0xF0,0xF9,0xF0,0xE0,0x70,
  51.         0xE0,0x70,0xF9,0xF0,0xF9,0xF0,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0
  52.     };
  53.  
  54. static unsigned char                oMinusSignNormal[] =
  55.     {
  56.         0xFF,0xF0,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x9F,0x90,
  57.         0x9F,0x90,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0xFF,0xF0
  58.     };
  59.  
  60. static unsigned char                oMinusSignMouseDown[] =
  61.     {
  62.         0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xE0,0x70,
  63.         0xE0,0x70,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0,0xFF,0xF0
  64.     };
  65.  
  66.  
  67. /* initialize the plus and minus bitmaps */
  68. MyBoolean                    InitializeLittleButtonImages(void)
  69.     {
  70.         PlusSignNormal = MakeBitmap(oPlusSignNormal,12,12,2);
  71.         if (PlusSignNormal == NIL)
  72.             {
  73.              FailurePoint1:
  74.                 return False;
  75.             }
  76.         PlusSignMouseDown = MakeBitmap(oPlusSignMouseDown,12,12,2);
  77.         if (PlusSignMouseDown == NIL)
  78.             {
  79.              FailurePoint2:
  80.                 DisposeBitmap(PlusSignNormal);
  81.                 goto FailurePoint1;
  82.             }
  83.         MinusSignNormal = MakeBitmap(oMinusSignNormal,12,12,2);
  84.         if (MinusSignNormal == NIL)
  85.             {
  86.              FailurePoint3:
  87.                 DisposeBitmap(PlusSignMouseDown);
  88.                 goto FailurePoint2;
  89.             }
  90.         MinusSignMouseDown = MakeBitmap(oMinusSignMouseDown,12,12,2);
  91.         if (MinusSignMouseDown == NIL)
  92.             {
  93.              FailurePoint4:
  94.                 DisposeBitmap(MinusSignNormal);
  95.                 goto FailurePoint3;
  96.             }
  97.         return True;
  98.     }
  99.  
  100.  
  101. /* dispose of the little button images */
  102. void                            ShutdownLittleButtonImages(void)
  103.     {
  104.         DisposeBitmap(PlusSignNormal);
  105.         DisposeBitmap(PlusSignMouseDown);
  106.         DisposeBitmap(MinusSignNormal);
  107.         DisposeBitmap(MinusSignMouseDown);
  108.     }
  109.